#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int luck(int x)
{
    if (x % 6 == 0)
        return 1;
    else
    {
        while (x)
        {
            int tmp = x % 10;
            if (tmp == 6)
                return 1;
            x /= 10;
        }
        return 0;
    }
}

int main()
{
    int m, n;
    scanf("%d%d", &m, &n);
    int find = 0;
    int count = 0;
    for (int i = m; i <= n; i++)
    {
        if (luck(i))
        {
            find = 1;
            count++;
            printf("%-8d", i);
            if (count % 6 == 0)
                printf("\n");
        }
    }
    if (!find)
        printf("None\n");
    return 0;
}